##########################################################
## Setar o diretorio de trabalho
##########################################################

setwd("/Users/felype/Documents/CIn/Mestrado/Estatistica/workspaceEstatistica/estatistica/ScriptR/base")
#setwd("/home/felipe/workspace-msc/estatistica/ScriptR/base")

##########################################################
##  Leitura dos Dados
##########################################################

#passo2, passo3, passo4, passo5
voluntario01git <- read.table("voluntario01git.txt",sep=",")
voluntario02git <- read.table("voluntario02git.txt",sep=",")
voluntario03git <- read.table("voluntario03git.txt",sep=",")
voluntario04git <- read.table("voluntario04git.txt",sep=",")
voluntario05git <- read.table("voluntario05git.txt",sep=",")
voluntario06git <- read.table("voluntario06git.txt",sep=",")
voluntario07git <- read.table("voluntario07git.txt",sep=",")
voluntario08git <- read.table("voluntario08git.txt",sep=",")
voluntario09git <- read.table("voluntario09git.txt",sep=",")
voluntario10git <- read.table("voluntario10git.txt",sep=",")
voluntario11git <- read.table("voluntario11git.txt",sep=",")
voluntario12git <- read.table("voluntario12git.txt",sep=",")
voluntario13git <- read.table("voluntario13git.txt",sep=",")
voluntario14git <- read.table("voluntario14git.txt",sep=",")
voluntario15git <- read.table("voluntario15git.txt",sep=",")
voluntario16git <- read.table("voluntario16git.txt",sep=",")

voluntario01svn <- read.table("voluntario01svn.txt",sep=",")
voluntario02svn <- read.table("voluntario02svn.txt",sep=",")
voluntario03svn <- read.table("voluntario03svn.txt",sep=",")
voluntario04svn <- read.table("voluntario04svn.txt",sep=",")
voluntario05svn <- read.table("voluntario05svn.txt",sep=",")
voluntario06svn <- read.table("voluntario06svn.txt",sep=",")
voluntario07svn <- read.table("voluntario07svn.txt",sep=",")
voluntario08svn <- read.table("voluntario08svn.txt",sep=",")
voluntario09svn <- read.table("voluntario09svn.txt",sep=",")
voluntario10svn <- read.table("voluntario10svn.txt",sep=",")
voluntario11svn <- read.table("voluntario11svn.txt",sep=",")
voluntario12svn <- read.table("voluntario12svn.txt",sep=",")
voluntario13svn <- read.table("voluntario13svn.txt",sep=",")
voluntario14svn <- read.table("voluntario14svn.txt",sep=",")
voluntario15svn <- read.table("voluntario15svn.txt",sep=",")
voluntario16svn <- read.table("voluntario16svn.txt",sep=",")


##########################################################
## Cada conjunto � um tipo de classe dessa flor
##########################################################

#passo2, passo5, passo3+passo4
#TCB, TIB, TIL
voluntario01git <- cbind(voluntario01git[1,2], voluntario01git[2:6,2],voluntario01git[2:6,5],voluntario01git[2:6,3]+voluntario01git[2:6,4])
voluntario02git <- cbind(voluntario02git[1,2], voluntario02git[2:6,2],voluntario02git[2:6,5],voluntario02git[2:6,3]+voluntario02git[2:6,4])
voluntario03git <- cbind(voluntario03git[1,2], voluntario03git[2:6,2],voluntario03git[2:6,5],voluntario03git[2:6,3]+voluntario03git[2:6,4])
voluntario04git <- cbind(voluntario04git[1,2], voluntario04git[2:6,2],voluntario04git[2:6,5],voluntario04git[2:6,3]+voluntario04git[2:6,4])
voluntario05git <- cbind(voluntario05git[1,2], voluntario05git[2:6,2],voluntario05git[2:6,5],voluntario05git[2:6,3]+voluntario05git[2:6,4])
voluntario06git <- cbind(voluntario06git[1,2], voluntario06git[2:6,2],voluntario06git[2:6,5],voluntario06git[2:6,3]+voluntario06git[2:6,4])
voluntario07git <- cbind(voluntario07git[1,2], voluntario07git[2:6,2],voluntario07git[2:6,5],voluntario07git[2:6,3]+voluntario07git[2:6,4])
voluntario08git <- cbind(voluntario08git[1,2], voluntario08git[2:6,2],voluntario08git[2:6,5],voluntario08git[2:6,3]+voluntario08git[2:6,4])
voluntario09git <- cbind(voluntario09git[1,2], voluntario09git[2:6,2],voluntario09git[2:6,5],voluntario09git[2:6,3]+voluntario09git[2:6,4])
voluntario10git <- cbind(voluntario10git[1,2], voluntario10git[2:6,2],voluntario10git[2:6,5],voluntario10git[2:6,3]+voluntario10git[2:6,4])
voluntario11git <- cbind(voluntario11git[1,2], voluntario11git[2:6,2],voluntario11git[2:6,5],voluntario11git[2:6,3]+voluntario11git[2:6,4])
voluntario12git <- cbind(voluntario12git[1,2], voluntario12git[2:6,2],voluntario12git[2:6,5],voluntario12git[2:6,3]+voluntario12git[2:6,4])
voluntario13git <- cbind(voluntario13git[1,2], voluntario13git[2:6,2],voluntario13git[2:6,5],voluntario13git[2:6,3]+voluntario13git[2:6,4])
voluntario14git <- cbind(voluntario14git[1,2], voluntario14git[2:6,2],voluntario14git[2:6,5],voluntario14git[2:6,3]+voluntario14git[2:6,4])
voluntario15git <- cbind(voluntario15git[1,2], voluntario15git[2:6,2],voluntario15git[2:6,5],voluntario15git[2:6,3]+voluntario15git[2:6,4])
voluntario16git <- cbind(voluntario16git[1,2], voluntario16git[2:6,2],voluntario16git[2:6,5],voluntario16git[2:6,3]+voluntario16git[2:6,4])

voluntario01svn <- cbind(voluntario01svn[1,2], voluntario01svn[2:6,2],voluntario01svn[2:6,5],voluntario01svn[2:6,3]+voluntario01svn[2:6,4])
voluntario02svn <- cbind(voluntario02svn[1,2], voluntario02svn[2:6,2],voluntario02svn[2:6,5],voluntario02svn[2:6,3]+voluntario02svn[2:6,4])
voluntario03svn <- cbind(voluntario03svn[1,2], voluntario03svn[2:6,2],voluntario03svn[2:6,5],voluntario03svn[2:6,3]+voluntario03svn[2:6,4])
voluntario04svn <- cbind(voluntario04svn[1,2], voluntario04svn[2:6,2],voluntario04svn[2:6,5],voluntario04svn[2:6,3]+voluntario04svn[2:6,4])
voluntario05svn <- cbind(voluntario05svn[1,2], voluntario05svn[2:6,2],voluntario05svn[2:6,5],voluntario05svn[2:6,3]+voluntario05svn[2:6,4])
voluntario06svn <- cbind(voluntario06svn[1,2], voluntario06svn[2:6,2],voluntario06svn[2:6,5],voluntario06svn[2:6,3]+voluntario06svn[2:6,4])
voluntario07svn <- cbind(voluntario07svn[1,2], voluntario07svn[2:6,2],voluntario07svn[2:6,5],voluntario07svn[2:6,3]+voluntario07svn[2:6,4])
voluntario08svn <- cbind(voluntario08svn[1,2], voluntario08svn[2:6,2],voluntario08svn[2:6,5],voluntario08svn[2:6,3]+voluntario08svn[2:6,4])
voluntario09svn <- cbind(voluntario09svn[1,2], voluntario09svn[2:6,2],voluntario09svn[2:6,5],voluntario09svn[2:6,3]+voluntario09svn[2:6,4])
voluntario10svn <- cbind(voluntario10svn[1,2], voluntario10svn[2:6,2],voluntario10svn[2:6,5],voluntario10svn[2:6,3]+voluntario10svn[2:6,4])
voluntario11svn <- cbind(voluntario11svn[1,2], voluntario11svn[2:6,2],voluntario11svn[2:6,5],voluntario11svn[2:6,3]+voluntario11svn[2:6,4])
voluntario12svn <- cbind(voluntario12svn[1,2], voluntario12svn[2:6,2],voluntario12svn[2:6,5],voluntario12svn[2:6,3]+voluntario12svn[2:6,4])
voluntario13svn <- cbind(voluntario13svn[1,2], voluntario13svn[2:6,2],voluntario13svn[2:6,5],voluntario13svn[2:6,3]+voluntario13svn[2:6,4])
voluntario14svn <- cbind(voluntario14svn[1,2], voluntario14svn[2:6,2],voluntario14svn[2:6,5],voluntario14svn[2:6,3]+voluntario14svn[2:6,4])
voluntario15svn <- cbind(voluntario15svn[1,2], voluntario15svn[2:6,2],voluntario15svn[2:6,5],voluntario15svn[2:6,3]+voluntario15svn[2:6,4])
voluntario16svn <- cbind(voluntario16svn[1,2], voluntario16svn[2:6,2],voluntario16svn[2:6,5],voluntario16svn[2:6,3]+voluntario16svn[2:6,4])


conjuntoMediasTCBgit = c(mean(voluntario01git[,2]),mean(voluntario02git[,2]),mean(voluntario03git[,2]),mean(voluntario04git[,2]),mean(voluntario05git[,2]), mean(voluntario06git[,2]), mean(voluntario07git[,2]), mean(voluntario08git[,2]), mean(voluntario09git[,2]), mean(voluntario10git[,2]), mean(voluntario11git[,2]), mean(voluntario12git[,2]), mean(voluntario13git[,2]), mean(voluntario14git[,2]), mean(voluntario15git[,2]), mean(voluntario16git[,2]))
conjuntoMediasTIBgit = c(mean(voluntario01git[,3]),mean(voluntario02git[,3]),mean(voluntario03git[,3]),mean(voluntario04git[,3]),mean(voluntario05git[,3]), mean(voluntario06git[,3]), mean(voluntario07git[,3]), mean(voluntario08git[,3]), mean(voluntario09git[,3]), mean(voluntario10git[,3]), mean(voluntario11git[,3]), mean(voluntario12git[,3]), mean(voluntario13git[,3]), mean(voluntario14git[,3]), mean(voluntario15git[,3]), mean(voluntario16git[,3]))
conjuntoMediasTILgit = c(mean(voluntario01git[,4]),mean(voluntario02git[,4]),mean(voluntario03git[,4]),mean(voluntario04git[,4]),mean(voluntario05git[,4]), mean(voluntario06git[,4]), mean(voluntario07git[,4]), mean(voluntario08git[,4]), mean(voluntario09git[,4]), mean(voluntario10git[,4]), mean(voluntario11git[,4]), mean(voluntario12git[,4]), mean(voluntario13git[,4]), mean(voluntario14git[,4]), mean(voluntario15git[,4]), mean(voluntario16git[,4]))

conjuntoMediasTCBsvn = c(mean(voluntario01svn[,2]),mean(voluntario02svn[,2]),mean(voluntario03svn[,2]),mean(voluntario04svn[,2]),mean(voluntario05svn[,2]), mean(voluntario06svn[,2]), mean(voluntario07svn[,2]), mean(voluntario08svn[,2]), mean(voluntario09svn[,2]), mean(voluntario10svn[,2]), mean(voluntario11svn[,2]), mean(voluntario12svn[,2]), mean(voluntario13svn[,2]), mean(voluntario14svn[,2]), mean(voluntario15svn[,2]), mean(voluntario16svn[,2]))
conjuntoMediasTIBsvn = c(mean(voluntario01svn[,3]),mean(voluntario02svn[,3]),mean(voluntario03svn[,3]),mean(voluntario04svn[,3]),mean(voluntario05svn[,3]), mean(voluntario06svn[,3]), mean(voluntario07svn[,3]), mean(voluntario08svn[,3]), mean(voluntario09svn[,3]), mean(voluntario10svn[,3]), mean(voluntario11svn[,3]), mean(voluntario12svn[,3]), mean(voluntario13svn[,3]), mean(voluntario14svn[,3]), mean(voluntario15svn[,3]), mean(voluntario16svn[,3]))
conjuntoMediasTILsvn = c(mean(voluntario01svn[,4]),mean(voluntario02svn[,4]),mean(voluntario03svn[,4]),mean(voluntario04svn[,4]),mean(voluntario05svn[,4]), mean(voluntario06svn[,4]), mean(voluntario07svn[,4]), mean(voluntario08svn[,4]), mean(voluntario09svn[,4]), mean(voluntario10svn[,4]), mean(voluntario11svn[,4]), mean(voluntario12svn[,4]), mean(voluntario13svn[,4]), mean(voluntario14svn[,4]), mean(voluntario15svn[,4]), mean(voluntario16svn[,4]))


#Para o cenario 0 somente o passo1 importa. O passo1 do experimento eh o passo2 no arquivo.
#TCA
conjuntoTCAgit = c(voluntario01git[1,1],voluntario02git[1,1],voluntario03git[1,1],voluntario04git[1,1],voluntario05git[1,1],voluntario06git[1,1],voluntario07git[1,1],voluntario08git[1,1],voluntario09git[1,1],voluntario10git[1,1],voluntario11git[1,1],voluntario12git[1,1],voluntario13git[1,1],voluntario14git[1,1],voluntario15git[1,1],voluntario16git[1,1])
conjuntoTCAsvn = c(voluntario01svn[1,1],voluntario02svn[1,1],voluntario03svn[1,1],voluntario04svn[1,1],voluntario05svn[1,1],voluntario06svn[1,1],voluntario07svn[1,1],voluntario08svn[1,1],voluntario09svn[1,1],voluntario10svn[1,1],voluntario11svn[1,1],voluntario12svn[1,1],voluntario13svn[1,1],voluntario14svn[1,1],voluntario15svn[1,1],voluntario16svn[1,1])



conjuntoTCBgit = c(voluntario01git[,2],voluntario02git[,2],voluntario03git[,2],voluntario04git[,2],voluntario05git[,2], voluntario06git[,2], voluntario07git[,2], voluntario08git[,2], voluntario09git[,2], voluntario10git[,2], voluntario11git[,2], voluntario12git[,2], voluntario13git[,2], voluntario14git[,2], voluntario15git[,2], voluntario16git[,2])
conjuntoTIBgit = c(voluntario01git[,3],voluntario02git[,3],voluntario03git[,3],voluntario04git[,3],voluntario05git[,3], voluntario06git[,3], voluntario07git[,3], voluntario08git[,3], voluntario09git[,3], voluntario10git[,3], voluntario11git[,3], voluntario12git[,3], voluntario13git[,3], voluntario14git[,3], voluntario15git[,3], voluntario16git[,3])
conjuntoTILgit = c(voluntario01git[,4],voluntario02git[,4],voluntario03git[,4],voluntario04git[,4],voluntario05git[,4], voluntario06git[,4], voluntario07git[,4], voluntario08git[,4], voluntario09git[,4], voluntario10git[,4], voluntario11git[,4], voluntario12git[,4], voluntario13git[,4], voluntario14git[,4], voluntario15git[,4], voluntario16git[,4])


conjuntoTCBsvn = c(voluntario01svn[,2],voluntario02svn[,2],voluntario03svn[,2],voluntario04svn[,2],voluntario05svn[,2], voluntario06svn[,2], voluntario07svn[,2], voluntario08svn[,2], voluntario09svn[,2], voluntario10svn[,2], voluntario11svn[,2], voluntario12svn[,2], voluntario13svn[,2], voluntario14svn[,2], voluntario15svn[,2], voluntario16svn[,2])
conjuntoTIBsvn = c(voluntario01svn[,3],voluntario02svn[,3],voluntario03svn[,3],voluntario04svn[,3],voluntario05svn[,3], voluntario06svn[,3], voluntario07svn[,3], voluntario08svn[,3], voluntario09svn[,3], voluntario10svn[,3], voluntario11svn[,3], voluntario12svn[,3], voluntario13svn[,3], voluntario14svn[,3], voluntario15svn[,3], voluntario16svn[,3])
conjuntoTILsvn = c(voluntario01svn[,4],voluntario02svn[,4],voluntario03svn[,4],voluntario04svn[,4],voluntario05svn[,4], voluntario06svn[,4], voluntario07svn[,4], voluntario08svn[,4], voluntario09svn[,4], voluntario10svn[,4], voluntario11svn[,4], voluntario12svn[,4], voluntario13svn[,4], voluntario14svn[,4], voluntario15svn[,4], voluntario16svn[,4])





#conjuntoTCBgit = c(mean(voluntario01_cen_01_11_git[,1]),mean(voluntario02_cen_01_11_git[,1]),mean(voluntario03_cen_01_11_git[,1]),mean(voluntario04_cen_01_11_git[,1]),mean(voluntario05_cen_01_11_git[,1]),mean(voluntario06_cen_01_11_git[,1]),mean(voluntario07_cen_01_11_git[,1]),mean(voluntario08_cen_01_11_git[,1]),mean(voluntario09_cen_01_11_git[,1]),mean(voluntario10_cen_01_11_git[,1]),mean(voluntario11_cen_01_11_git[,1]),mean(voluntario12_cen_01_11_git[,1]),mean(voluntario13_cen_01_11_git[,1]),mean(voluntario14_cen_01_11_git[,1]),mean(voluntario15_cen_01_11_git[,1]),mean(voluntario16_cen_01_11_git[,1]))
#conjuntoTIBgit = c(mean(voluntario01_cen_01_11_git[,2]),mean(voluntario02_cen_01_11_git[,2]),mean(voluntario03_cen_01_11_git[,2]),mean(voluntario04_cen_01_11_git[,2]),mean(voluntario05_cen_01_11_git[,2]),mean(voluntario06_cen_01_11_git[,2]),mean(voluntario07_cen_01_11_git[,2]),mean(voluntario08_cen_01_11_git[,2]),mean(voluntario09_cen_01_11_git[,2]),mean(voluntario10_cen_01_11_git[,2]),mean(voluntario11_cen_01_11_git[,2]),mean(voluntario12_cen_01_11_git[,2]),mean(voluntario13_cen_01_11_git[,2]),mean(voluntario14_cen_01_11_git[,2]),mean(voluntario15_cen_01_11_git[,2]),mean(voluntario16_cen_01_11_git[,2]))
#conjuntoTILgit = c(mean(voluntario01_cen_01_11_git[,3]),mean(voluntario02_cen_01_11_git[,3]),mean(voluntario03_cen_01_11_git[,3]),mean(voluntario04_cen_01_11_git[,3]),mean(voluntario05_cen_01_11_git[,3]),mean(voluntario06_cen_01_11_git[,3]),mean(voluntario07_cen_01_11_git[,3]),mean(voluntario08_cen_01_11_git[,3]),mean(voluntario09_cen_01_11_git[,3]),mean(voluntario10_cen_01_11_git[,3]),mean(voluntario11_cen_01_11_git[,3]),mean(voluntario12_cen_01_11_git[,3]),mean(voluntario13_cen_01_11_git[,3]),mean(voluntario14_cen_01_11_git[,3]),mean(voluntario15_cen_01_11_git[,3]),mean(voluntario16_cen_01_11_git[,3]))
#
#conjuntoTCBsvn = c(mean(voluntario01_cen_01_11_svn[,1]),mean(voluntario02_cen_01_11_svn[,1]),mean(voluntario03_cen_01_11_svn[,1]),mean(voluntario04_cen_01_11_svn[,1]),mean(voluntario05_cen_01_11_svn[,1]),mean(voluntario06_cen_01_11_svn[,1]),mean(voluntario07_cen_01_11_svn[,1]),mean(voluntario08_cen_01_11_svn[,1]),mean(voluntario09_cen_01_11_svn[,1]),mean(voluntario10_cen_01_11_svn[,1]),mean(voluntario11_cen_01_11_svn[,1]),mean(voluntario12_cen_01_11_svn[,1]),mean(voluntario13_cen_01_11_svn[,1]),mean(voluntario14_cen_01_11_svn[,1]),mean(voluntario15_cen_01_11_svn[,1]),mean(voluntario16_cen_01_11_svn[,1]))
#conjuntoTIBsvn = c(mean(voluntario01_cen_01_11_svn[,2]),mean(voluntario02_cen_01_11_svn[,2]),mean(voluntario03_cen_01_11_svn[,2]),mean(voluntario04_cen_01_11_svn[,2]),mean(voluntario05_cen_01_11_svn[,2]),mean(voluntario06_cen_01_11_svn[,2]),mean(voluntario07_cen_01_11_svn[,2]),mean(voluntario08_cen_01_11_svn[,2]),mean(voluntario09_cen_01_11_svn[,2]),mean(voluntario10_cen_01_11_svn[,2]),mean(voluntario11_cen_01_11_svn[,2]),mean(voluntario12_cen_01_11_svn[,2]),mean(voluntario13_cen_01_11_svn[,2]),mean(voluntario14_cen_01_11_svn[,2]),mean(voluntario15_cen_01_11_svn[,2]),mean(voluntario16_cen_01_11_svn[,2]))
#conjuntoTILsvn = c(mean(voluntario01_cen_01_11_svn[,3]),mean(voluntario02_cen_01_11_svn[,3]),mean(voluntario03_cen_01_11_svn[,3]),mean(voluntario04_cen_01_11_svn[,3]),mean(voluntario05_cen_01_11_svn[,3]),mean(voluntario06_cen_01_11_svn[,3]),mean(voluntario07_cen_01_11_svn[,3]),mean(voluntario08_cen_01_11_svn[,3]),mean(voluntario09_cen_01_11_svn[,3]),mean(voluntario10_cen_01_11_svn[,3]),mean(voluntario11_cen_01_11_svn[,3]),mean(voluntario12_cen_01_11_svn[,3]),mean(voluntario13_cen_01_11_svn[,3]),mean(voluntario14_cen_01_11_svn[,3]),mean(voluntario15_cen_01_11_svn[,3]),mean(voluntario16_cen_01_11_svn[,3]))


#conjunto1 <- read.table("git.txt",sep=",")
#conjunto2 <- read.table("svn.txt",sep=",")


##########################################################
## Conjunto Total
##########################################################

#conjuntos <- rbind(conjuntos1,conjuntos2)
#medPop <- mean(conjuntos)




###########################################################
## Calculo do teste de hip�tese com base na m�dia
###########################################################

#Hip1 <- wilcox.test(medAmos,medAmos2,alternative=c("two.sided"),paired=TRUE)
#Rej1 = ifelse (Hip1$p.value<0.05, 1, 0)

#Hip2 <- t.test(medAmos,medAmos2,alternative=c("two.sided"),paired=TRUE)
#Rej2 = ifelse (Hip2$p.value<0.05, 1, 0)


